#include <event2/event.h>

/* Here’s a callback function that calls loopbreak*/
void cb(int sock, short what, void* arg)
{
    struct event_base* base = arg;
    event_base_loopbreak(base);
}
void main_loop(struct event_base* base, evutil_socket_t watchdog_fd)
{
    struct event* watchdog_event;
    /* Construct a new event to trigger whenever there are any bytes to
    read from a watchdog socket. When that happens, we’ll call the
    cb function, which will make the loop exit immediately without
    running any other active events at all.*/
    watchdog_event = event_new(base, watchdog_fd, EV_READ, cb, base);
    event_add(watchdog_event, NULL);
    event_base_dispatch(base);
}
int main(){
    return 0;
}